Skip to content

build(docker): pin Ubuntu OpenJDK versions and apply OS security updates - #7122

Open
3for wants to merge 4 commits into
tronprotocol:release_v4.8.3from
3for:feat/pin_jdk_version
Open

3for wants to merge 4 commits into
tronprotocol:release_v4.8.3from
3for:feat/pin_jdk_version

Conversation

@3for

@3for 3for commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Upgrade packages inherited from the Ubuntu 24.04 base image before installing build dependencies. Both Dockerfiles now fail the build if APT cannot refresh any package index.
  • On amd64, replace the Temurin download with Ubuntu OpenJDK 8u514-b01~us1-0ubuntu1~24.04.1. Build and unpack java-tron with the headless JDK, then remove it and point JAVA_HOME at the retained JRE.
  • On arm64, pin Ubuntu OpenJDK 17.0.21.1+2-1~24.04.1. Use the headless JRE’s compiler and jdk.jartool modules to build and unpack java-tron, eliminating the 7-Zip dependency.
  • Document how to find, test, and update the pinned Ubuntu package version for each architecture.

Why are these changes required?

The previous builds refreshed the APT index but could retain older versions of libc6, libpcre2-8-0, and apt from the base image. Upgrading installed packages during a fresh build picks up the available Ubuntu fixes.

Using Ubuntu packages for Java also removes a separate download and verification path on amd64. The previous build used curl to fetch a Temurin archive and its signature, then retrieved a signing key from a public keyserver and verified the archive with GPG. APT authenticates Ubuntu’s signed repository metadata and checks the downloaded packages against the hashes it contains. This reduces the build’s attack surface by removing those extra endpoints and verification steps. Ubuntu archive verification

This PR has been tested by:

  • Unit Tests — The Docker builds skip the Java unit suite. This PR changes Docker packaging and documentation.
  • Manual Testing — Built both images and ran FullNode --version on each. Verified the pinned JRE packages and confirmed both final images contain libc6 2.39-0ubuntu8.12, libpcre2-8-0 10.42-4ubuntu2.2, and apt 2.8.4ubuntu0.1.
  • Manual Testing — On arm64, all 156 files in bin/, lib/, and config.conf had the same SHA-256 hashes as in the previous 7-Zip build. FullNode also started with an empty database, created the genesis block, and started its API and P2P services.

Follow up

We will track quarterly and out-of-cycle OpenJDK security advisories, Ubuntu Security Notices and noble-security package availability, and Eclipse Temurin releases for Java 8 on Linux amd64 and Java 17 on Linux arm64. If an upstream advisory or Temurin release precedes the Ubuntu package, we will check which fixes apply to our runtime and architecture and track the Ubuntu package until it is available. OpenJDK advisories · Ubuntu Security Notices · Temurin release policy

When Ubuntu publishes a fixed package, test the full package version with --build-arg OPENJDK_VERSION=..., verify Java and FullNode, then update the corresponding Dockerfile default and rebuild the image. The steps are in docker/docker.md.

Extra details

Latest security update. Following the November 17, 2026 OpenJDK advisory, Temurin delivered the amd64 Java 8 runtime about 4 hours earlier, while Ubuntu delivered the arm64 Java 17 runtime about 47.5 hours earlier. The comparison uses the upload time of the architecture-specific Temurin JRE archive and the publication time of Ubuntu’s jre-headless package in noble-security. All times are UTC. November 17 OpenJDK advisory

Runtime used by java-tron Eclipse Temurin Ubuntu 24.04 Publication records
Java 8 8u514-b01, amd64 Nov 19, 23:07 Nov 20, 03:00 Temurin JRE · Ubuntu package
Java 17 17.0.21.1+2, arm64 Nov 20, 21:53 Nov 18, 22:24 Temurin JRE · Ubuntu package
  • Java 8 security coverage. On Ubuntu 24.04, OpenJDK 17 is in main and receives standard Canonical security maintenance. OpenJDK 8 is in universe, where standard coverage is community-supported. Ubuntu published the pinned 8u514 fix through noble-security without requiring Ubuntu Pro. Delivery times for future updates may vary. Ubuntu security maintenance policy · Ubuntu OpenJDK 8 notice
  • Rebuilds and rollback. Both builds use the live Ubuntu repositories so fresh builds can pick up system security fixes. When Ubuntu replaces a pinned Java version in the index, a fresh build for that architecture can fail until the pin is updated. The Dockerfiles also build the remote master branch. For an exact rollback, retain the published image and redeploy it by digest.

3for added 3 commits November 23, 2026 13:05
Upgrade packages inherited from the Ubuntu 24.04 base image so fresh
builds pick up security fixes on both amd64 and arm64. Fail the build
if APT cannot refresh any package index.
Install OpenJDK 8 from Ubuntu on amd64. Pin the headless JDK and JRE
to the same package version, use the JDK to build and unpack java-tron,
and point JAVA_HOME at the retained JRE after purging the build tools.

Pin the Ubuntu OpenJDK 17 headless JRE on arm64 and use its jdk.jartool
module to unpack the distribution. Restore launcher permissions on both
architectures and remove the tools used only during the build.
Show how to look up the available Ubuntu package versions for each
architecture and test a replacement with the OPENJDK_VERSION build
argument. Verify the runtime and FullNode before changing the default.
@github-actions
github-actions Bot requested a review from kuny0707 November 23, 2026 05:07

@SeriousCoding789 SeriousCoding789 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small gap I noticed: docker.md explains that a fresh build can fail once Ubuntu replaces the pinned package, and shows --build-arg OPENJDK_VERSION=... for building with a newer one. docker.sh --build, however, accepts only an architecture argument and runs docker build with just --platform, --file and --tag, so that override is not available through the helper; users of the script would need to edit the Dockerfile or call docker build directly. Forwarding an OPENJDK_VERSION environment variable as a build argument when it is set would close this gap.

@3for

3for commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

One small gap I noticed: docker.md explains that a fresh build can fail once Ubuntu replaces the pinned package, and shows --build-arg OPENJDK_VERSION=... for building with a newer one. docker.sh --build, however, accepts only an architecture argument and runs docker build with just --platform, --file and --tag, so that override is not available through the helper; users of the script would need to edit the Dockerfile or call docker build directly. Forwarding an OPENJDK_VERSION environment variable as a build argument when it is set would close this gap.

@SeriousCoding789 Good point! Done in a29e447.

@SeriousCoding789 SeriousCoding789 removed this from the GreatVoyage-v4.8.3 milestone Nov 24, 2026
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.8.3 milestone Nov 26, 2026
@317787106 317787106 removed this from the GreatVoyage-v4.8.3 milestone Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants